use std::process::Command;
fn main() {
    // 子进程应用示例
    let output = Command::new("rustc")
    .arg("--version")
        .output().unwrap_or_else(|e| {panic!("Failed to execute rustc: {}", e)});
    if output.status.success() {
        let s = String::from_utf8_lossy(&output.stdout);
        print!("rustc succeeded and stdout was:\n{}", s);
    } else {
        let s = String::from_utf8_lossy(&output.stderr);
        print!("rustc failed and stderr was:\n{}", s);
    }
}


